package com.sgj.watchinyou.datasource;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class MySQLiteOpenHelper extends SQLiteOpenHelper{

	private static final String Q_CREATE_TABLE= "CREATE TABLE my_location (" +
	        "_id INTEGER PRIMARY KEY AUTOINCREMENT," +
			"latitude TEXT," +
	        "longitude TEXT," +
			"accuracy TEXT," +
			"time TEXT" +
			");";
	
	public MySQLiteOpenHelper(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(Q_CREATE_TABLE);
	}
	
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE my_location");
		onCreate(db);
	}
}



